var t = getApp();

Page({
    data: {
        pageData: {},
        memberInfo: {}
    },
    onLoad: function(t) {
        this.getData();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getData: function() {
        var e = this, a = t.getNetAddresss("plugin.first-class.api.set.indexInfo");
        t._getNetWork({
            url: a,
            data: {
                index: "index"
            },
            success: function(t) {
                var a = t.data;
                1 == a.result ? (e.setData({
                    pageData: a.data.index.set,
                    memberInfo: a.data.index.member_level
                }), wx.setNavigationBarTitle({
                    title: a.data.index.set.title || ""
                })) : wx.showToast({
                    icon: "none",
                    title: a.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    goPage: function(t) {
        var e = t.currentTarget.dataset.id, a = t.currentTarget.dataset.url, n = this.data.memberInfo.yz_member.level_id;
        if ("-1" == e || e == n) try {
            wx.navigateTo({
                url: a
            });
        } catch (t) {
            wx.showToast({
                title: "链接设置错误",
                icon: "none",
                duration: 1200
            });
        } else wx.showToast({
            icon: "none",
            title: "级别不符,请选择对应等级",
            duration: 1200
        });
    },
    calliPhone: function() {
        wx.makePhoneCall({
            phoneNumber: this.data.pageData.mobile
        });
    }
});